package com.hunt.util;


/**
 * @Author sjs
 * @Date 2020/10/26
 * @Description 过滤html标签获取纯文本信息
 */

public class FilterHtmlUtil {

    public static String  Html2Text(String inputString){
        String str = "<[a-zA-Z]+[1-9]?[^><]*>";
        String str2 = "</[a-zA-Z]+[1-9]?>";
        String str3 = "&nbsp;";
        String str4 = "\r";
        String str5 = "\n";
        String str6 = "\t";

        return inputString.replaceAll(str, "")
                .replaceAll(str2,"")
                .replaceAll(str3,"")
                .replaceAll(str4,"")
                .replaceAll(str5,"")
                .replaceAll(str6,"");

    }

    public static String LecturerDetail2Text(String inputStr){
        String str1 = "\r";
        String str2 = "\n";


        return inputStr.replaceAll(str1, "")
                .replaceAll(str2,"");

    }


}